﻿@model Guid
@{    
    var data = Sealight.UI.WebUI.Services.ProductService.GetAllCategory();
    IList<Sealight.UI.WebUI.Models.ProductCategoryViewModel> model = new List<Sealight.UI.WebUI.Models.ProductCategoryViewModel>();
    
    foreach(var c in data)
    {
        var tem = c;
        tem.DisplayName = c.Name;
        model.Add(tem);
        if(c.Childrens!= null)
        {
           foreach(var i in c.Childrens)
           {
               var del = i;
               del.DisplayName = "--" + i.Name;
               model.Add(del);
           }
        }
    }
}
@(Html.Telerik().DropDownList().Name("Category")
.BindTo(new SelectList(model, "CategoryID", "DisplayName", Model))

)